package com.loeng.module.system.service.logger;

import com.loeng.framework.common.util.object.BeanUtils;
import com.loeng.module.system.api.logger.dto.LoginLogCreateReqDTO;
import com.loeng.module.system.dal.dataobject.logger.LoginLogDO;
import com.loeng.module.system.dal.mysql.logger.LoginLogMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 登录日志 Service 实现
 * @author loeng zhuo
 */
@Service
public class LoginLogServiceImpl implements LoginLogService {

    @Resource
    private LoginLogMapper loginLogMapper;

    /**
     * 创建登录日志
     *
     * @param loginLogCreateReqDTO 创建登录日志 Request DTO
     */
    @Override
    public void createLoginLog(LoginLogCreateReqDTO loginLogCreateReqDTO) {
        LoginLogDO loginLogDO = BeanUtils.toBean(loginLogCreateReqDTO, LoginLogDO.class);
        loginLogMapper.insert(loginLogDO);
    }

}
